home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Instructions
- BackColor = &H00C0C0C0&
- Caption = "Instructions"
- ClientHeight = 4470
- ClientLeft = 1740
- ClientTop = 2235
- ClientWidth = 6495
- Height = 4875
- Left = 1680
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4470
- ScaleWidth = 6495
- Top = 1890
- Width = 6615
- Begin CommandButton ExitButton
- Cancel = -1 'True
- Caption = "Close"
- Default = -1 'True
- Height = 375
- Left = 5640
- TabIndex = 0
- Top = 240
- Width = 735
- End
- Begin TextBox List1
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 3975
- Left = 240
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 1
- TabStop = 0 'False
- Text = "Text1"
- Top = 240
- Width = 5295
- End
- DefInt A-Z
- Sub ExitButton_Click ()
- Close FileNUM%
- Unload INSTRUCTIONS
- End Sub
- Function FileErrors (errVal As Integer) As Integer
- msgType% = MB_ICONEXCLAMATION
- Select Case errVal
- Case ERR_DEVICEUNAVAILABLE
- Msg$ = "That device appears unavailable."
- msgType% = MB_ICONEXCLAMATION + 4
- Case ERR_DISKNOTREADY
- Msg$ = "Insert a disk in the drive and close the door."
- Case ERR_DEVICEIO
- Msg$ = "Internal disk error."
- msgType% = MB_ICONEXCLAMATION + 4
- Case ERR_DISKFULL
- Msg$ = "Disk is full. Continue?"
- msgType% = 35
- Case Err_BADFILENAME, ERR_BADFILENAMEORNUMBER
- Msg$ = "That filename is illegal."
- Case ERR_PATHDOESNOTEXIST
- Msg$ = "That path doesn't exist."
- Case ERR_BADFILEMODE
- Msg$ = "Can't open your file for that type of access."
- Case ERR_FILEALREADYOPEN
- Msg$ = "This file is already open"
- Case ERR_INPUTPASTENDOFFILE
- Msg$ = "This file has a nonstandard end-of-file marker, "
- Msg$ = Msg$ + "or an attempt was made to read beyond "
- Msg$ = Msg$ + "the end-of-file marker."
- Case Else
- FileErrors = 3
- Exit Function
- End Select
- response% = MsgBox(Msg$, msgType%, "Disk Error")
- Select Case response%
- Case 1, 4
- FileErrors = 0
- Case 5
- FileErrors = 1
- Case 2, 3
- FileErrors = 2
- Case Else
- FileErrors = 3
- End Select
- End Function
- Function Fileopener (NameToUse$, Mode%, RecordLen%) As Integer
- Const READFILE = 2
- FileNUM% = FreeFile
- On Error GoTo OpenerError
- Open NameToUse For Input As FileNUM%
- Fileopener = FileNUM%
- Exit Function
- OpenerError:
- Action% = FileErrors(Err)
- Select Case Action%
- Case 0
- Resume
- Case Else
- Fileopener = 0
- Exit Function
- End Select
- End Function
- Sub Form_Load ()
- Openfile
- End Sub
- Sub Form_Paint ()
- AUTOREDRAW = True
- Call Frame2(INSTRUCTIONS, 60, 60, INSTRUCTIONS.Height - 530, INSTRUCTIONS.Width - 254)
- Call Frame(INSTRUCTIONS, LIST1.Left - 5, LIST1.top - 5, LIST1.Height + 10, LIST1.Width + 10)
- End Sub
- Sub List1_GotFocus ()
- Exitbutton.SetFocus
- End Sub
- Sub Openfile ()
- WorkingFileName = Windir + "\SYS2.TXT"
- OpenMode% = READFILE
- FileNUM% = Fileopener(WorkingFileName, OpenMode%, 0)
-
- On Error GoTo ReadError
- If LOF(FileNUM%) > 60000 Then
- Msg$ = "Sorry your file is too large to edit."
- MsgBox Msg$, 16, "File Too Big"
- Exit Sub
- End If
- Do Until EOF(FileNUM%)
- Line Input #FileNUM%, NextLine$
- LineFromFile$ = LineFromFile$ + NextLine$ + Chr$(13) + Chr$(10)
- Loop
- LIST1.Text = LineFromFile$
- Close FileNUM%
- Exit Sub
- ReadError:
- Action% = FileErrors(Err)
- Select Case Action%
- Case 0
- Resume
- Case 1
- Resume Next
- Case 2
- Exit Sub
- End Select
- End Sub
-